#include "XFtpCDUP.h"
#include "LogWrapper.h"
#include "XFtpSession.h"

XFtpCDUP::XFtpCDUP()
{
}

XFtpCDUP::~XFtpCDUP()
{
}

void XFtpCDUP::parse(const std::string & type, const std::string & msg)
{
    std::string path = mSesssion->getCurDir();
    if (path[path.size() - 1] == '/') {
        path = path.substr(0, path.size() - 1);
    }
    size_t pos = path.rfind('/');
    if (pos != path.npos) {
        path = path.substr(0, pos);
        mSesssion->setCurDir(path);
    }
    responseFtpCmd("250 Directory succes chanaged.\r\n");
}
